package com.example.demo.service;//package com.example.demo1.service;
//
//import com.example.demo1.mapper.UserMapper;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.stereotype.Service;
//
//import java.util.Objects;
//@Service
//public class DetailService implements UserDetailsService {
//    @Autowired
//    private UserMapper userMapper;
//    @Override
//    public UserDetails loadUserByUsername(String account) throws UsernameNotFoundException {
//        com.example.demo1.entity.User_Test2 user = userMapper.getUserByName(account);
//        if (Objects.isNull(user)) {
//            throw new UsernameNotFoundException("user name not found");
//        }
//        return user;
//    }
//}
